home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_100 / 144_01 / example.hlp < prev    next >
Text File  |  1985-08-19  |  4KB  |  199 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.                                     EXAMPLES
  7.  
  8.         LIST FILES IN A NICE FORMAT ON THE SCREEN
  9.  
  10.         Build a submit file with the following command.  It will put out
  11.         a  very  nice  5  column list of filenames sorted verticaly.  No
  12.         arguments will give a list of all files.  A wild  card  argument
  13.         will  give  a  limited display like DIR.  a second argument will
  14.         allow the output to be sent to a file or the printer.
  15.  
  16.                 LS $1 |2UP -L22N5W $2
  17.  
  18.         PRINT A TEXT FILE WITH A LEFT MARGIN FOR 3-HOLE PUNCHING
  19.  
  20.                 PAGE <file -M10 >lst:
  21.  
  22.         BUILDING SUBMIT FILES
  23.  
  24.         The  following  sequence  will  create a file CLEAN.SUB which is
  25.         a submit job to clean control characters out  of  all  files  of
  26.         type xxx.
  27.  
  28.                 LS *.xxx |SUB * CLEAN_<*_>* >CLEAN.SUB
  29.  
  30.         A BACKUP SUBMIT FILE BUILDER
  31.  
  32.         The  following  sequence  will create  a  file  BACKUP.SUB which
  33.         is  a submit job to backup all files of type xxx from disk A: to
  34.         disk B:.
  35.  
  36.                 LS *.xxx |SUB * COPY_B:*_=A:* >BACKUP.SUB
  37.  
  38.         Either of the above sequences were themselves placed in  a  .SUB
  39.         file.  Thus, if the file BLDBKUP.SUB contained:
  40.  
  41.                 LS *.$1 |SUB * COPY_B:*_=A:* >BACKUP.SUB
  42.  
  43.         Then the command:
  44.  
  45.                 SUBMIT BLDBKUP BAS
  46.  
  47.         would create the file BACKUP.SUB to backup  all  .BAS  files and
  48.         the command
  49.  
  50.                 SUBMIT BACKUP
  51.  
  52.         would execute that function.
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.         CREATING AN INDEX FROM A DOCUMENT FILE
  73.  
  74.         The  following commands in a submit file would allow an index to
  75.         be  built  for  any  text   file   by  use  of  a  single submit
  76.         command.
  77.  
  78.          WORDS <$1 -NL66 |SORT -C9U |MERGE -C9UI NOISE.WRD >$TEMP$
  79.          INDEX -C29 <$TEMP$ |2UP -M10L60C29S2 |PAGE >INDEX.DOC
  80.          ERA $TEMP$
  81.  
  82.         Which would be called by:
  83.  
  84.                 SUBMIT INDEX filename
  85.  
  86.         This  would  create  an index based on  66  line  pages  of  the
  87.         named  file.  The index would be formatted in  2  columns spaced
  88.         out  on  a  66  line  page  format.  The index would contain all
  89.         words in the text except those contained in  the NOISE.WRD  file
  90.         which contains "noise words" such as "the", "and", etc.
  91.  
  92.         Create the NOISE.WRD file from a  text   file   containing  just
  93.         noise words by:
  94.  
  95.                 WORDS <NOISE.TXT -N |SORT -C9U >NOISE.WRD
  96.  
  97.         The   same   submit  file  can be modified by changing the "L66"
  98.         after WORDS  to  "L1"  and  would   give   a   cross   reference
  99.         instead.
  100.  
  101.         ANOTHER TYPE OF BACKUP STRATEGY
  102.  
  103.         If  you  use  an  editor  which creates .BAK files types for any
  104.         file  modified,  you can use this as  a  signal  to  select  out
  105.         files for backing up.  The following submit file can  be used.
  106.  
  107.                 LS *.BAK |SUB { COPY_B:=A: |SUB .BAK .* >BKUP.SUB
  108.                 ERA *.BAK
  109.  
  110.         This   creates  a  file  BKUP.SUB to backup to disk B: all files
  111.         named the same as the .BAK file.
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.         BRACE CHECKING IN C PROGRAMS
  139.  
  140.         A common problem in C programs is having unmatched {   }  pairs.
  141.         These   are   difficult  to  locate  and a simple search for one
  142.         character in an editor or with SELECT  will  not  do  the   job.
  143.         The   following   submit  commands  will  find and display lines
  144.         containing either bracket along with the  line number  for  that
  145.         line.
  146.  
  147.                 SUB <$1.C \} \{\}\{ |SELECT \{ -N |SUB \{\}\{ \} $2
  148.  
  149.         The   $2   argument   allows   the  default  output to be to the
  150.         screen, but the output can  be   redirected   to   the   printer
  151.         (>LST:) or a file.
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.